package com.zyp.composite;

/**
 * 叶子节点
 * @author Administrator
 *
 */
public class Leaf extends IComponent{

	public Leaf(String name) {
		super(name);
	}

	@Override
	public void add(IComponent component) {
		
	}

	@Override
	public void remove(IComponent component) {
		
	}

	@Override
	public void display(int depth) {
		StringBuilder sb = new StringBuilder("");
		for (int i = 0; i < depth; i++) {
			sb.append("-");
		}
      System.out.println(new String(sb) + this.getName() ) ;
	}

}
